<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <base href="<?php echo base_url(); ?>"/>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

        <title>Trang chủ</title>
        <link rel="stylesheet" type="text/css" media="all" href="resources/home/css/incentives.css" />
        <link rel="stylesheet" type="text/css" media="all" href="resources/home/css/reset.css" />
        <link rel="stylesheet" type="text/css" media="all" href="resources/home/css/960.css" />
        <link rel="stylesheet" type="text/css" media="all" href="resources/home/css/style.css" />
        <link rel="stylesheet" type="text/css" media="all" href="resources/home/css/search_style.css" />
        <link rel="stylesheet" href="resources/home/css/screen_ivivu.css" type="text/css"/>
        <link rel="stylesheet" type="text/css" href="resources/home/css/superfish.css" media="screen" />
        <link rel="stylesheet" type="text/css" media="all" href="resources/home/css/featuredslider.css" />
        <link rel="stylesheet" type="text/css" media="all" href="resources/home/css/calendar.css" />
        <link rel="stylesheet" type="text/css" media="all" href="resources/home/css/tvtivivu.css" />
        <link rel="stylesheet" type="text/css" media="screen" href="resources/home/css/ivivu_pick.css" />
        <link rel="stylesheet" type="text/css" href="resources/home/css/cupertino/jquery-ui-1.9.2.custom.min.css" />
        <link rel="stylesheet" type="text/css" href="resources/home/css/compare.css" />
        
<!--        <script type="text/javascript" src="resources/home/scripts/jquery.min.js"></script>  -->        
        <script type="text/javascript" src="resources/home/scripts/jquery-1.3.2.min.js"></script>
		<script type="text/javascript" src="resources/home/scripts/jquery-1.8.3.js"></script>
		<script type="text/javascript" src="resources/home/scripts/jquery.datePicker.js"></script>         
		<script type="text/javascript" src="resources/home/scripts/jquery.date.js"></script>
        <script type="text/javascript" src="resources/home/scripts/script.js"></script>
		<script type="text/javascript" src="resources/home/scripts/jquery-ui-1.9.2.custom.min.js"></script>

	    <style>
	    	.ui-autocomplete-category 
			{
				font-family: Verdana, Geneva, sans-serif;
        		font-weight: bold;
	        	padding: .2em .4em;
				color: #06F;
				font-size: 14px;
			}
	    </style>        

    </head>
    <body>       
        <div class="bg">               
            <div class="header">    <!--start:header --> 
                <div class="container_16">                
                    <!--start:header container -->
                    <!--start:logo -->
                    <div class="grid_5"> 
                        <a href="index.php/home"><img src="resources/home/images/logo.png" alt="DesignPlus" class="pngfix logo"/></a>
                    </div>
                    <!--end:logo -->
                    <div class="grid_11">
                        <!--start:menu grid -->
                        <div class="top-menu pngfix">
                            <!--start:menu top-menu -->
                            <ul class="sf-menu">
                                <!--start:sf-menu -->
                                <li class="current"> <a href="<?php echo current_url(); ?>">Trang chủ</a> </li>
                                <li> <a href="<?php echo site_url('GioiThieu'); ?>">Giới thiệu</a> </li>
                                <li> <a href="<?php echo site_url('khuyenmai'); ?>">Khuyến mãi</a></li>
                                <li> <a href="<?php echo site_url('nhacungcap'); ?>">Đối tác</a> </li>
                                <li> <a href="<?php echo site_url('LienHe'); ?>">Liên hệ - Hỗ trợ</a> </li>
                            </ul>
                            <!--end:sf-menu -->
                            <span class="rightcorner pngfix"></span> </div>
                        <!--end:menu top-menu -->
                   		</div>
                    <!--end:menu grid -->
                    	<div class="clear">&nbsp;</div>
	                    <div class="grid_16">
                            <div id="listsosanh">
                                <?php $this->load->view('home/danhsach_sosanh_view'); ?>
                            </div>
                        <!--start:featured slider grid -->
    	                    <div class="slider_bg pngfix">
                            <!--start:slider_bg -->
        	                    <ul id="slideshow">
                                <!--start:slideshow -->
            	                    <?php foreach ($khachsantieubieu as $row): ?>
                	                    <li>
                    	                    <!--start:slideshow content and image -->
                        	                <h3><?php echo $row->TenKhachSan; ?></h3>
                            	            <span><?php echo $row->HinhLon; ?></span>
                                	        <!--an image only -->
                                    	    <p><?php echo substr($row->ThongTin, 0, 350) . '...'; ?>   <br />
                                        	    <a href="<?php echo site_url('datphong/khachsan/' . $row->MaKS); ?>" class="readmoremain">Chi tiết</a> </p>
	                                        <img src="<?php echo $row->HinhNho; ?>" alt="img-<?php echo $row->MaHA; ?>" />
    	                                    <!--an image thumbnail only -->
        	                            </li>
            	                        <!--end:slideshow content and image -->
                	                <?php endforeach; ?>
	                            </ul>
    	                        <!--end:slideshow -->
        	                    <div id="wrapper">
            	                    <!--start:wrapper -->
                	                <div id="fullsize">
                    	                <!--start:fullsize -->
                        	            <div id="imgprev" class="imgnav pngfix" title="Previous"></div>
                            	        <div id="imglink"></div>
                                	    <div id="imgnext" class="imgnav pngfix" title="Next"></div>
                                    	<div id="image"></div>
	                                    <div id="information">
                                        <!--start:information -->
    	                                    <h3></h3>
        	                                <p></p>
            	                        </div>
                	                    <!--end:information -->
                    	            </div>
                        	        <!--end:fullsize -->
                            	    <div id="thumbnails">
                                	    <!--start:thumbnails -->
                                    	<div id="slideleft" title="Slide Left"></div>
	                                    <div id="slidearea">
    	                                    <!--start:slidearea -->
        	                                <div id="slider"></div>
            	                        </div>
	                                    <!--start:slidearea -->
    	                                <div id="slideright" title="Slide Right"></div>
        	                        </div>
            	                    <!--end:thumbnails -->
                	            </div>
                    	        <!--end:wrapper -->
                        	</div>
                        <!--end:slider_bg -->

                        <!--Begin Search form-->
                        	<div class="searchform">
        	                    <div class="header_02">
            	                    <div class="moduletable">
                	                    <div class="layout_search_page"><div id="from_search_booking" class='vi'>
                    	                    <div id="archor_search" style="position: absolute; top: 10px;"></div>
                                            <div class="wrap"></div>
                                            <div class="header02_right">
												<div class="header_search_01"> 
													<div id="txtcommit" class="base_color"> Các khách sạn Việt Nam và Quốc tế</div> 
													<div id="quick_search" onclick="displayButton(1)">
														<form action="<?php echo site_url('searchKhachSan/search_Hotel') ?>" id="form_search_name" name="form_search_name" method="post" >
										        			<input type="text" size="50" maxlength="80" id="searchname" name="searchname" value="Nhập tên thành phố hoặc tên khách sạn..." onfocus='clearText(this)' onblur='clearText(this)' class="B_input" />
											        		<input type="hidden" id="tp" name="tp" value=""/>
															<input type="hidden" id="qg" name="qg" value=""/>
															<input type="hidden" id="kv" name="kv" value=""/>    
                                                        <div id="search_button_1" class="button1" style="display:inline; width:65px; margin-left:5px; padding-left:5px; padding-right:5px; padding-top:5px; padding-bottom:5px;">Tìm kiếm</div>
														</div>
													</div>
													<div class="header_search_02">
														<div id="destination_search" onclick="displayButton(2)">
												    		<select id='id_des_country' class="option_search" name="id_des_country" onchange="getCityByCountry();" style="width:120px">
												        		<option value="" selected="selected">Quốc gia</option>
													            <?php 
																	foreach ($country as $row) 
																	{ 
												    	    	    	echo "<option value='$row->QuocGia'>$row->QuocGia</option>";
												        	    	} 
													            ?>
												    	    </select>

												        	<select id='id_des_city' class="option_search" name="id_des_city" onchange="getRegionByCity(); displayButton(2);" style="width:120px;">
												        		<option value="" selected="selected">Thành phố</option>
													    	</select>

												    	    <select id='id_des_region' class="option_search" name="id_des_region" style="width:120px">
													        	<option value="" selected="selected">Khu vực</option>
												    		</select>
                                                            
                                                            <div id="search_button_2" class="button1" style="display:none; width:65px; padding-left:5px; padding-right:5px; padding-top:5px; padding-bottom:5px;">Tìm kiếm</div>
														</div>
													</div>
												   	<div class="base_color"><font size="+1"><b> Ngày nhận phòng: </b></font></div>
												       	<input id="date" type="text" class="date_search" value='<?php echo date('d/m/Y'); ?>' />
                                                        <input type='hidden' name='date' id='actualDate_tim' value='<?php echo date('Y-m-d', strtotime("now")); ?>' />
														</form>
												</div>
                        	            </div>
                            	    </div><!--End moduleTable-->
	                            </div><!--End Header_02-->
    	                    </div><!--End Search Form-->
                        </div>

                        <!--start:featured slider script -->
                        <script type="text/javascript">
                            $('slideshow').style.display='none';
                            $('wrapper').style.display='block';
                            var slideshow=new TINY.slideshow("slideshow");
                            window.onload=function()
							{
                                slideshow.auto=true;
                                slideshow.speed=5;
                                slideshow.link="linkhover";
                                slideshow.info="information";
                                slideshow.thumbs="slider";
                                slideshow.left="slideleft";
                                slideshow.right="slideright";
                                slideshow.scrollSpeed=4;
                                slideshow.spacing=5;
                                slideshow.active="#aaa";
                                slideshow.init("slideshow","image","imgprev","imgnext","imglink");
                            }
                        </script>
                        <!--send:featured slider script -->
                        
						<script type="text/javascript">
							jQuery.widget( "custom.catcomplete", jQuery.ui.autocomplete, {
								_renderMenu: function( ul, items ) {
									var that = this;
										currentCategory = "";
									jQuery.each( items, function( index, item ) {
										if ( item.category != currentCategory ) {
											ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );
											currentCategory = item.category;
										}
										that._renderItemData( ul, item );
									});
								}
							});	
																	  
							jQuery(function()
							{	  
								jQuery( "#searchname" ).catcomplete(
								{							  
									source: function (request, response)
									{
										jQuery.ajax(
										{
											url: "index.php/khachsan/LayThanhPho_TenKhachSan_ajax",
											type: 'POST',
											dataType: "json",
											data: 
											{
												style: "full",
												maxRows: 12,
												name_startsWith: request.term
											},					
											success: function(msg)
											{
												response(jQuery.map(msg, function(item)
												{
													return {label: item.label, category: item.category};
												}));
											}
										});
									},
									minLength: 2
								});
								
							   jQuery( "#date" ).datepicker(
							   {
									changeMonth: true,
									changeYear: true,
									altField: '#actualDate_tim',
									altFormat: 'yy-mm-dd',
									dateFormat: 'dd/mm/yy'
								});	   							  
							});
							
							function clearText(field)
							{
				    			if (field.defaultValue == field.value) field.value = '';
			    				else if (field.value == '') field.value = field.defaultValue;
							}
							
							function displayButton(btn)
							{
								btn1 = document.getElementById("search_button_1");
								btn2 = document.getElementById("search_button_2");
								
								if(btn == 1)
								{
									btn1.style.display = "inline";
									btn2.style.display = "none";
								}
								else 
								{	
									btn2.style.display = "inline";
									btn1.style.display = "none";
									document.getElementById("searchname").value = document.getElementById("searchname").defaultValue;
								}
							}
							
                            jQuery("#id_des_country").change(function()
                            {
                                var form_data = 
                                {
                                    choice: '1', 
                                    quocgia:jQuery('#id_des_country').val()
                                };
                                jQuery.ajax(
                                {
                                    url: "<?php echo site_url('searchKhachSan/getCityByCountry'); ?>",
                                    type: "POST",
                                    data: form_data,
                                    dataType: 'html',
                                    success: function(mgs)
                                    {
                                        jQuery('#destination_search').html(mgs);
                                        jQuery('#qg').val(jQuery('#id_des_country').val());
                                    }
                                });
                             });
                        
                             jQuery("#id_des_city").change(function()
                             {				
                                var form_data = 
                                {
                                    choice: '2',
                                    quocgia:jQuery('#id_des_country').val(),
                                    thanhpho:jQuery('#id_des_city').val()
                                };
                                jQuery.ajax(
                                {
                                    url: "<?php echo site_url('searchKhachSan/getRegionByCity'); ?>",
                                    type:"POST",
                                    data: form_data,
                                    dataType: 'html',
                                    success: function(mgs)
                                    {
                                        jQuery('#destination_search').html(mgs);
                                        jQuery('#tp').val(jQuery('#id_des_city').val());
                                    }
                                });
                            });
                            
                            jQuery("#id_des_region").change(function()
                            {
                                jQuery('#kv').val(jQuery('#id_des_region').val());
                            });
                                                                    
                            jQuery("#search_button_1").click(function()
                            {
                                if(jQuery('#searchname').val()=='Nhập tên thành phố hoặc tên khách sạn...')
                                {
                                    alert("Xin vui lòng nhập tên khách sạn (hoặc thành phố)!");
									return;
                                }
                                jQuery('#form_search_name').submit();
                            });
							
                            jQuery("#search_button_2").click(function()
                            {
								if(jQuery('#id_des_country').val()=="")
								{
                                	alert("Xin vui lòng lựa chọn các tiêu chí có sẵn!");
                                    return;
                                }
                                if(jQuery('#id_des_city').val()=="")
                                {
                                	alert("Xin vui lòng chọn thành phố!");
                                    return;
                                }
                                jQuery('#form_search_name').submit();
                            });							
                        </script>                        
                    </div>
                    <!--end:header container -->
                </div>                
            </div>
            <!--end:header -->
            <div class="clear">&nbsp;</div>
            <div class="container_16">          
                <!--start:content container -->
                <div class="box-content">                 
                    <!--start:box-content -->
                    <div id="layout_ivivu_pick">
                        <div style="padding-left:30px;"><h3 style="font-size:26px;color:#2c73b1;font-style:italic;"> i12 Chọn</h3></div>

                        <div id="content_ivivu_pick">
                            <div class="left" style="width:300px">
                                <h3 style="font-size:14px; margin:0;"><b>Khách Sạn Đang Có Khuyến Mãi</b></h3>
                                <ul class="ul_hotels_list1">
                                    <?php foreach ($khachsandangcokhuyenmai as $row): ?>
                                        <li style="list-style:none;margin:0;padding:8px 0;"> <span style="font-size: 11px; width: 232px; float: left;"><a href="<?php echo site_url('datphong/khachsan/' . $row->MaKhachSan); ?>" target="_blank" title="<?php echo $row->TenKhachSan; ?>"><?php echo $row->TenKhachSan; ?></a></span> <span style="font-size: 11px; width: 60px; float: left;">Giảm <?php echo $row->GiaTriKhuyenMai; ?>%</span> </li>                                                                                        
                                    <?php endforeach; ?>
                                </ul>        
                            </div>
                            <div class="right" style="width:400px;">
                                <h3 style="font-size:14px; margin:0;"><b>Khách Sạn Tốt Nhất (thang điểm 10)</b></h3>
                                <ul class="ul_hotels_list1">
                                    <?php foreach ($khachsantotnhat as $row): ?>
                                        <li style="list-style:none;margin:0;padding:8px 0;"> <span style="font-size: 11px; width: 180px; float: left;"><a href="<?php echo site_url('datphong/khachsan/' . $row->MaKS); ?>" target="_blank" title="<?php echo $row->TenKhachSan; ?>"><?php echo $row->TenKhachSan; ?></a></span> <span style="font-size: 11px; width: 150px; float: left;"><a href="<?php echo site_url('datphong/khachsantrongvung/'. $row->QuocGia . '/' . $row->Tinh_ThanhPho); ?>" target="_blank" title="<?php echo $row->Tinh_ThanhPho; ?>"><?php echo $row->Tinh_ThanhPho; ?></a></span> <span style="font-size: 11px; width: 62px; float: left;"><?php echo $row->Diem; ?> điểm</span> </li>                                                                                        
                                    <?php endforeach; ?>
                                </ul>        
                            </div>
                            <div class="wrap"></div>
                        </div> 
                    </div>
                </div>
                <!--end:box-content -->
            </div>
            <!--end:content container -->
            <div class="clear"></div>
            <!-- End middle content -->
            <div class="footer">           
                <!--start:footer -->
                <div class="container_16">
                    <!--start:footer container -->
                    <div class="footer_left">
                        <!--start:footer left part-->
                        <p> &copy; Copyright 2012 <a href="index.php/home" target="_blank">i12 Online Booking | N12~SuperStar</a></p>
                    </div>
                    <!--start:footer left part-->
                    <div class="footer_right">
                        <!--start:footer right part-->
                        <p>Designed and Developed by <a href="http://www.themeflash.com" target="_blank">Themeflash.com</a></p>
                    </div>
                    <!--end:footer right part-->
                </div>
                <!--end:footer container -->
            </div>
            <center>Design Downloaded from <a href="http://www.template4all.com/" title="free website templates" target="_blank">Free Website Templates</a> | <a href="http://www.freethemes4all.com/" title="free css templates" target="_blank">free css templates</a> | <a href="http://www.seodesign.us" title="free psd files" target="_blank">Free PSD Files</a></center>
            <!--end:footer -->           
    </body>
</html>